package com.qf.hospital.controller;

import com.qf.hospital.service.DoctorService;
import com.qf.hospital.service.RegisterService;
import com.qf.hospital.service.ReportService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author ASUS
 * @version V1.0
 * @Project hospital
 * @Package com.qf.hospital.controller
 * @Date 2021/10/19 18:36
 */
@RestController
public class MainController {

    private Logger log = LoggerFactory.getLogger(MainController.class);

    @Autowired
    private DoctorService doctorService;

    @Autowired
    private ReportService reportService;

    @Autowired
    private RegisterService registerService;

    /**
     *查询首页排班信息
     * @param week 星期几？
     * @return
     */
    @PostMapping("/main/{week}")
    public List<Map<String,Object>> scheduler(@PathVariable String week){
        List<Map<String,Object>> result = doctorService.findSchedulerByWeek(week);
        return result;
    }

    /**
     * 门诊总人数
     * @return
     */
    @PostMapping("/main/Total")
    public Integer reportTotal(){
        return reportService.findReportCountTotal();
    }

    /**
     * 今日门诊总人数
     * @return
     */
    @PostMapping("/main/currentNum")
    public Integer findReportCountCurrent(){
        return reportService.findReportCountCurrent();
    }

    /**
     * 住院总人数
     * @return
     */
    @PostMapping("/main/zhuyuanTotal")
    public Integer zhuyuanTotal(){
        return registerService.zhuyuanTotal();
    }

    /**
     * 今日住院总人数
     * @return
     */
    @PostMapping("/main/currentZhuYuan")
    public Integer currentZhuYuan(){
        return registerService.currentZhuYuan();
    }




}
